package com.magi.config;

import com.magi.constant.DatabaseProducts;

public class BuildingConfig implements IDatabaseConfig, IJavaMapperBuildingConfig, IJavaPojoBuildingConfig, IXmlMapperBuildingConfig{
    private String username;
    private String password;
    private String databaseURL;
    private String databaseProductName = DatabaseProducts.MYSQL;
    private String outputPath = "C:\\Users\\Public\\Desktop\\product\\";

    private String selectedTable;

    private String rootPackageName = "com.test";
    private String rootMapperPackageName;
    private String rootPojoPackageName;

    public String getOutputPath() {
        return outputPath;
    }

    public void setOutputPath(String outputPath) {
        this.outputPath = outputPath;
    }

    public String getSelectedTable() {
        return selectedTable;
    }

    public void setSelectedTable(String selectedTable) {
        this.selectedTable = selectedTable;
    }

    public void setDatabaseProductName(String databaseProductName) {
        this.databaseProductName = databaseProductName;
    }

    @Override
    public String getRootPackageName() {
        return rootPackageName;
    }

    public void setRootPackageName(String rootPackageName) {
        this.rootPackageName = rootPackageName;
    }

    @Override
    public String getRootMapperPackageName() {
        if (rootMapperPackageName == null) {
            return rootPackageName + ".mapper";
        }
        return rootMapperPackageName;
    }

    public void setRootMapperPackageName(String rootMapperPackageName) {
        this.rootMapperPackageName = rootMapperPackageName;
    }

    @Override
    public String getRootPojoPackageName() {
        if (rootPojoPackageName == null) {
            return rootPackageName + ".pojo";
        }
        return rootPojoPackageName;
    }

    public void setRootPojoPackageName(String rootPojoPackageName) {
        this.rootPojoPackageName = rootPojoPackageName;
    }

    @Override
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String getDatabaseURL() {
        return databaseURL;
    }

    public void setDatabaseURL(String databaseURL) {
        this.databaseURL = databaseURL;
    }

    @Override
    public String getDatabaseProductName() {
        return databaseProductName;
    }

}
